package com.qcby.demo.proxyaop.proxy.jdk;

import com.qcby.demo.proxyaop.proxy.star.JiaLing;
import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @className: TvHandler
 * @description: 电视剧代理类
 * @author: lxt
 * @create: 2021-05-12 15:30
 **/
@Slf4j
public class TvHandler implements InvocationHandler {

    private JiaLing jiaLing;

    // 经纪人和贾玲建立关系
    public TvHandler(JiaLing jiaLing) {
        this.jiaLing = jiaLing;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        log.info("贾玲的代理正在与您沟通【拍电视剧】...");
        method.invoke(jiaLing,args);
        log.info("贾玲的代理正在完成收尾【拍电视剧】...");
        return null;
    }
}
